#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPaintEvent>
//#include <QProcess>
#include <QLabel>
#include <QImage>
#include <QScreen>
#include <QDesktopWidget>
#include <QApplication>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    //void paintEvent(QPaintEvent *event);
    QString getTextFromYiYan();
    void DrawBackground();
    //QProcess *curl=new QProcess;
    void refresh();
    void keyPressEvent(QKeyEvent *event);
    int transparency;
    int Pic=1;
    void RefreshTime();
    QString backgroundPath();
    QString backgroundpath;
    bool ConcurrentIsFree;
    QLabel *BgLabel=new QLabel(this);
    QPixmap DownloadPic();
    void replyFinished(QNetworkReply *reply);
    void SaveFile(QByteArray file);
    QByteArray ImageData;
    QNetworkAccessManager downloader;
    QLabel *filling=new QLabel(this);
    QImage currentWallpaper;
    QString getCurrentNum();
    int Max;
    //void WriteConfig();
    //void ReadConfig();
    QString num;
    void setAuther(QString from,QString fromWho);
    //QScreen *screen = QGuiApplication::primaryScreen ();
    QRect screenRect = QApplication::desktop()->screenGeometry();

private slots:
    void on_refreshBtn_clicked(bool checked);

    void on_selectPathBtn_clicked(bool checked);

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
